home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util4 / anegato.lha / A.negato1.2 / Source / ASetup.code < prev    next >
Text File  |  1992-09-02  |  2KB  |  62 lines

  1. WBStartup : WbToScreen 0 ;eseguibile da Workbench
  2. SetErr:DisplayBeep_(0):End:End SetErr ;in caso di errore, esce senza GURU
  3. LoadFont 0,"topaz.font",8
  4. Window 0,35,15,0,100,$8,"",1,2 : yy=WTopOff-11 ;yy: per controllare la
  5. Dim vet.s(5)                                   ;grandezza dei font
  6.  
  7. b=15
  8. For a=0 To 5 Step 2                    ;i 3 gadget
  9.   StringGadget 0,10,15+b+yy,0,a,19,120 ;di sinistra.
  10.   b+15                                 ;La lunghezza max di input
  11.                                        ;è di 19 caratteri
  12. Next
  13.  
  14. b=15
  15. For a=1 To 5 Step 2
  16.   StringGadget 0,160,15+b+yy,0,a,19,120 ;e quelli di destra
  17.   b+15
  18. Next
  19. BorderPens 2,1
  20. TextGadget 0,124,80+yy,0,6," Usa "
  21.  
  22. Window 0,35,15,300,100+yy,$1000|$2|$4|$8,"Accesso negato 1.2 - T.dMan 1/1995",1,2,0
  23. WindowFont 0 ;usiamo il font topaz 8
  24.  
  25. Repeat ;main loop
  26. WLocate 29,5:Print"NOMI UTENTI"
  27. WLocate 190,5:Print"PASSWORD"
  28.  
  29. w.l=WaitEvent ;attende finchè non si verifica un evento nella window 0
  30.   If w=$200 End ;close window 
  31.   If w=$40 AND GadgetHit=6 Gosub usa ;se USE è stato cliccato e
  32.                                      ;rilasciato: VAI a "usa"
  33. Forever
  34.  
  35. usa ;label
  36.  
  37. For a=0 To 5
  38. vet(a)=LCase$(StringText$(0,a)) ;assegna ai vettori vet[0..5] quanto è stato
  39.                         ;inserito nelle stringhe, e lo converte in minuscolo
  40. Next
  41.  
  42. If vet(0)="" AND vet(2)="" AND vet(4)="" ;se TUTTE le stringhe "NOMI" sono
  43.                                          ;vuote, ritorna al main loop
  44.   DisplayBeep_(0)
  45.   Return
  46. End If
  47.  
  48. If OpenFile(0,"S:ANeg") ;questo e FIELD gestiscono un file ad accesso casuale
  49.   MaxLen d$=40 ;ogni campo puo' contenere
  50.   MaxLen e$=40 ;al massimo 40 caratteri 
  51.   MaxLen f$=40 ;
  52.   Fields 0,d$,e$,f$ 
  53.   d$=vet(0)+vet(1)
  54.   e$=vet(2)+vet(3)
  55.   f$=vet(4)+vet(5)
  56.   Put 0,0 ;registra come d$, e$, f$ NOMI+PASSWORD
  57.   CloseFile 0
  58. Else
  59.   DisplayBeep_(0)
  60. End If
  61. End
  62.